import org.apache.commons.lang3.time.DateUtils;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.util.Date;

public class testclassify {
    public static void main(String[] args) {
        File file = new File("/Users/lx/Desktop/32gw2_081518.txt");
        BufferedReader reader = null;
        String temp = null;
        int line = 1;
        try {
            reader = new BufferedReader(new FileReader(file));
            while ((temp = reader.readLine()) != null) {
                System.out.println("line" + line + ":" + temp);
                String[] strArr = temp.split(",");
                String dateStr = strArr[0];
                Date date = DateUtils.parseDate(dateStr, "yyyy-MM-dd HH:mm:ss");
                String mobile = strArr[1];
                String statusStr = strArr[2];
                Integer status = Integer.parseInt(statusStr);
                String content = strArr[3];
                System.out.println(date.getTime());
                System.out.println(mobile);
                System.out.println(status);
                System.out.println(content);

                line++;

            }
            /*Iterator it = lineSet.iterator();
            while (it.hasNext()) {
                System.out.println(it.next());
            }*/
            /*for (Map.Entry<String, Integer> entry : map.entrySet()) {
                System.out.println("Key = " + entry.getKey() + ", Value = " + entry.getValue());
            }*/

        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (reader != null) {
                try {
                    reader.close();
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
